// import CellSwipe from '../packages/cell-swipe';

// import Spinner from '../packages/spinner';
// import TabItem from '../packages/tab-item';
// import TabContainerItem from '../packages/tab-container-item';
// import TabContainer from '../packages/tab-container';
// import Navbar from '../packages/navbar';
// import Tabbar from '../packages/tabbar';


// import Loadmore from '../packages/loadmore';
// import Actionsheet from '../packages/actionsheet';

// import Swipe from '../packages/swipe';
// import SwipeItem from '../packages/swipe-item';

// import Picker from '../packages/picker';
// import Progress from '../packages/progress';
// import Lazyload from '../packages/lazyload';
// import DatetimePicker from '../packages/datetime-picker';
// import IndexList from '../packages/index-list';
// import IndexSection from '../packages/index-section';
// import PaletteButton from '../packages/palette-button';

// 上方的组件按照需求一个个添加，以mint-ui为主，cube-ui为辅

import InfiniteScroll from "../packages/infinite-scroll";
import MessageBox from "../packages/message-box";
import Indicator from "../packages/indicator";
import Toast from "../packages/toast";

import Button from "../packages/button";
import Header from "../packages/header";
import Radio from "../packages/radio";
import Cell from "../packages/cell";
import Switch from "../packages/switch";
import Badge from "../packages/badge";
import Range from "../packages/range";
import Field from "../packages/field";
import Checklist from "../packages/checklist";
import Search from '../packages/search';
import Popup from '../packages/popup';
import Picker from "../packages/picker";

// import "../src/assets/font/iconfont.css";
// import merge from "./utils/merge";

const components = [
  Button,
  Header,
  Cell,
  Switch,
  Radio,
  Badge,
  Range,
  Field,
  Checklist,
  Search,
  Popup,
  Picker
];
const version = "2.2.13";
// const install = function (Vue, config = {}) {

const install = function (Vue) {
  if (install.installed) return;

  components.forEach((component) => {
    Vue.component(component.name, component);
  });

  Vue.use(InfiniteScroll);
  // Vue.use(
  //   Lazyload,
  //   merge(
  //     {
  //       loading: require("./assets/loading-spin.svg"),
  //       attempt: 3,
  //     },
  //     config.lazyload
  //   )
  // );

  Vue.$messagebox = Vue.prototype.$messagebox = MessageBox;
  Vue.$toast = Vue.prototype.$toast = Toast;
  Vue.$indicator = Vue.prototype.$indicator = Indicator;
};

export default {
  version,
  install,
};
